@extends('admin._layouts.default')

<script language="javascript" type="text/javascript" src="{{ URL::asset('ueditor/ueditor.config.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('ueditor/ueditor.config.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('ueditor/ueditor.all.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('ueditor/lang/zh-cn/zh-cn.js') }}"></script>
@section('main')

      <div class="row-fluid ">
        <div class="span12 box gradient ">
      <div class="title">
            <div class="row-fluid">
                <h3><a class="btn btn-mini pull-right mg5"><i class="fa fa-hand-o-left"></i> 返回</a>
                  <i class="fa fa-barcode"></i> 新增3X型号
                </h3>
            </div>
        </div><!-- End .title -->
        <div class="content">
            {{ Form::open(array('route' => 'admin.machines.store','files'=>true,'id'=>'cities','class'=>'form-horizontal  row-fluid')) }}
                  <div class="form-row control-group row-fluid">
                    <label class="control-label span3" for="text">型号名称</label>
                    <div class="controls span6">
                      <div class="input-prepend row-fluid">
                        <span class="add-on prepend "><i class="fa fa-cube "></i></span>
                        <input name="name" class="row-fluid" id="cloth2" required  size="50" type="text" >
                      </div>
                    </div>
                  </div>
                  <div class="form-row control-group row-fluid">
                    <label class="control-label span3" for="text">主机价格</label>
                    <div class="controls span6">
                      <div class="input-prepend row-fluid">
                        <span class="add-on prepend "> <i class="fa fa-cny "></i> </span>
                        <input name="price" class="row-fluid" id="author" required  size="50" type="text">
                      </div>
                    </div>
                  </div>
                  <div class="form-row control-group row-fluid">
                    <label class="control-label span3" for="search-input">封面头图 <span class="help-block">建议尺寸：900像素 * 500像素</span></label>
                    <div class="controls span7">
                      <div class="input-append row-fluid">
                        <input type="file" name="cover" class="spa1n6 fileinput" id="search-input">
                      </div>
                    </div>
                  </div>

                  <div class="form-row control-group row-fluid">
                    <label class="control-label span3" for="text">宝贝摘要</label>
                    <div class="controls span6">
                      <textarea name="dec" id="text" rows="2" class="row-fluid"></textarea>
                      <div id="bottom">
                        <span id="chars">100</span> 字剩余
                      </div>
                    </div>
                  </div>
                  <div class="form-row control-group row-fluid">
                    <label class="control-label span3" for="editor1">宝贝描述
                    </label>
                    <div class="controls span6">
                        <script id="editor" type="text/plain" style="height:500px;"></script>
                    </div>
                  </div>
                  <div class="form-row control-group row-fluid">
                    <label class="control-label span3" for="text">选择滤芯</label>
                    <div class="controls span6">
                      <select data-placeholder="依次添加滤芯" name="filter[]" class="chzn-select" multiple="" tabindex="3">
                      @foreach($commodities as $commodity)
                    <option value="{{ $commodity->id }}">{{ $commodity->name }}</option>
                    @endforeach
                  </select>
                    </div>
                  </div>
                  <div class="form-row control-group row-fluid">
                    <label class="control-label span3" for="text">城市价格体系</label>
                    <div class=" span6" id="city-price">
                    @foreach($areas as $area)
                      <div class=" span5 mgt5">
                        {{ $area->name }}：<input type="text" class="input_number"  name="{{ $area->id }}" required>
                      </div>
                      @endforeach
                    </div>


                  </div>
                  <div class="form-actions row-fluid">
                    <div class="span10 offset3">
                      <button type="submit" class="btn btn-large btn-info"><i class="fa fa-save"></i> 立即保存</button>
                      <button type="button" class="btn btn-large"><i class="fa fa-hand-o-left"></i> 取消</button>
                    </div>
                  </div>
                {{ Form::close() }}




            </div>
        </div>
        <!-- End box -->
      </div>

@stop


@section('modals')
@stop


@section('script')
<script language="javascript" type="text/javascript" src="{{ URL::asset('ad/js/plugins/full-calendar/fullcalendar.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('ad/js/plugins/jquery.peity.min.js') }}"></script>
<script type="text/javascript" language="javascript" src="{{ URL::asset('ad/js/plugins/datatables/js/jquery.dataTables.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('ad/js/plugins/chosen/chosen/chosen.jquery.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('ad/js/plugins/flot/jquery.flot.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('ad/js/plugins/jquery.uniform.min.js') }}"></script>
<script src="{{ URL::asset('ad/js/plugins/justGage.1.0.1/resources/js/raphael.2.1.0.min.js') }}"></script>
<script src="{{ URL::asset('ad/js/plugins/justGage.1.0.1/resources/js/justgage.1.0.1.min.js') }}"></script>
<script src="{{ URL::asset('ad/js/scripts.js') }}"></script>


    <script type="text/javascript" charset="utf-8">
    // Datatables
    $(document).ready(function() {
      var dontSort = [];
                $('#datatable_city thead th').each( function () {
                    if ( $(this).hasClass( 'no_sort' )) {
                        dontSort.push( { "bSortable": false } );
                    } else {
                        dontSort.push( null );
                    }
      } );
      $('#datatable_city').dataTable( {
        "sDom": "<'row table_top_bar'<'row-fluid'>'<'to_hide_phone'>'f'<'>r>t<'row'>",
         "sDom": "<'row table_top_bar'<'row-fluid'<'to_hide_phone' f>>><'row'>",
         "aaSorting": [[ 1, "asc" ]],
        "bPaginate": false,
        "bJQueryUI": false,
        "aoColumns": dontSort

      } );
      $.extend( $.fn.dataTableExt.oStdClasses, {
        "s`": "dataTables_wrapper form-inline"
      } );
    } );
    </script>
<script type="text/javascript">

    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor');

</script>
@stop
